package model;

import java.util.Date;

/**
 * 商品评分实体类
 */
public class Rating {
    // 评分ID
    private int id;
    // 用户ID
    private int user_id;
    // 商品ID
    private int goods_id;
    // 评分 (1-5)
    private int score;
    // 评论内容
    private String comment;
    // 创建时间
    private Date create_time;
    // 关联的用户对象
    private User user;
    // 关联的商品对象
    private Goods goods;

    public Rating() {
    }

    public Rating(int user_id, int goods_id, int score, String comment) {
        this.user_id = user_id;
        this.goods_id = goods_id;
        this.score = score;
        this.comment = comment;
        this.create_time = new Date();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getGoods_id() {
        return goods_id;
    }

    public void setGoods_id(int goods_id) {
        this.goods_id = goods_id;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Date getCreate_time() {
        return create_time;
    }

    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    @Override
    public String toString() {
        return "Rating{" +
                "id=" + id +
                ", user_id=" + user_id +
                ", goods_id=" + goods_id +
                ", score=" + score +
                ", comment='" + comment + '\'' +
                ", create_time=" + create_time +
                '}';
    }
} 